#include <bits/stdc++.h>
using namespace std;
int T, N, M;
int p[105][105];
int dp[10005];
int main() {
    cin >> T >> N >> M;
    for (int i = 1; i <= T; i++)
        for (int j = 1; j <= N; j++)
            cin >> p[i][j];
    int m = M;
    for (int day = 1; day < T; day++) {
        memset(dp, 0, sizeof(dp));
        for (int i = 1; i <= N; i++) {
            int c = p[day][i];
            int val = p[day + 1][i] - p[day][i];
            if (val <= 0) continue;
            for (int j = c; j <= m; j++)
                dp[j] = max(dp[j], dp[j - c] + val);
        }
        m += dp[m];
    }
    cout << m << endl;
    return 0;
}
